//使用饿汉
class Singleton{
    private static Singleton instance = new Singleton();
    public static Singleton getInstance(){
        return instance;
    }

    private Singleton(){

    }
}
 class Homework2 {
     public static void main(String[] args) {
         Thread t1 = new Thread(()->{
             Singleton s1 = Singleton.getInstance();
         });
         Thread t2 = new Thread(()->{
             Singleton s2 = Singleton.getInstance();
         });
         t1.start();
         t2.start();
     }
}
